package cc.linker.steplink.crm.merchant.pojo;

import com.alibaba.fastjson.JSON;
import lombok.Getter;
import lombok.Setter;
import org.omg.CORBA.INTERNAL;

import java.text.DecimalFormat;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @Author: CKQ
 * @DateTime: 2020/5/22 17:28
 * @Description: TODO
 */
@Getter
@Setter
public class FreightAreaPo {

    //区域ID
    public  Long areaId;

    //模板ID
    public  String templateId;

    //区域JSON
    public String areaJson;

    //区域列表
    public List<AreaPo> getAreaList() {
        if (this.areaJson != "" && this.areaJson != null) {
            return JSON.parseArray(this.areaJson, AreaPo.class);
        } else {
            return null;
        }
    }
    //首件个数
    public Integer lastNum;

    //运费
    public Integer freight;

    //运费计算过的价格
    public String getStrFreight(){
        DecimalFormat df = new DecimalFormat("0.00");
        return df.format(Double.parseDouble(this.freight.toString()) / 100).toString();
    }

    //续件
    public  Integer continueNum;

    //续费
    public  Integer continueCost;

    //续费价格
    public String getStrContinueCost(){
        DecimalFormat df = new DecimalFormat("0.00");
        return df.format( Double.parseDouble(this.continueCost.toString()) / 100).toString();
    }

    //创建时间
    public Date createTime;

}
